<%-- 
    Document   : showOrder
    Created on : 2015-6-29, 12:50:40
    Author     : MY
--%>

<%@page import="bookstore.model.Orderdetails"%>
<%@page import="bookstore.model.Order"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>ShowOrder</title>
        <link rel="stylesheet" href="/iBook/css/all.css" type="text/css"/>
        <link rel="stylesheet" href="/iBook/css/bootstrap.min.css" type="text/css"/>
    </head>
    <body>
        <jsp:include  page="/common/top.jsp"/>
        <div class="container">
            <table class="table table-hover table-striped">
                <tr ><th style="width: 600px">订单信息</th><th>收货人</th><th>订单金额</th><th>订单时间</th><th>操作</th></tr>
                        <%
                            List<Order> orderList = (List<Order>) session.getAttribute("orderList");
                            if (orderList != null) {
                                for (int i = 0; i < orderList.size(); ++i) {
                                    Order order = orderList.get(i);
                                    List<Orderdetails> detailsList = order.getOrderdetails();
                        %>
                <tr> <td>
                    <%
                        for (int j = 0; j < detailsList.size(); ++j) {
                    %>

                   <div>               
                       <img src="/iBook/bookimages/<%=detailsList.get(j).getBook().getPicture()%>"  height="80" width="60" class="img-thumbnail" style="float: left ">   
                   <%}%>     
                   </div>
                        
                    </td>
                    <td><%=order.getReciever() %></td>
                    <td><%=order.getTotal() %></td>
                    <td ><%=order.getDatetime() %></td>
                    <td><a href="#" class="btn btn-danger btn-sm">付款</a></td>
                </tr>
                <%
                        }
                    }

                %>
            </table>
        </div>         
    </body>
</html>
